stages:
  - build
  - deploy

build-job:
  stage: build
  script:
    - echo "Compiling the code..."
    - /home/tg-bot/install_requirements.sh
    - echo "Compile complete."


deploy-job:
  stage: deploy
  environment: production
  script:
    - echo "Deploying application..."
    - echo "Sync files..."
    - rsync -av --no-perms --no-owner --no-group --exclude ".git*" $CI_PROJECT_DIR/ /home/tg-bot
    - /home/tg-bot/restart_services.sh
    - echo "Application successfully deployed."
